package business.article.entities;

import java.util.ArrayList;

import article.entities.ArticleVO;
import article.entities.ComboVO;

public class Combo extends Article{

private ArrayList<Article> arts;
	
	
	public ArrayList<Article> getArts() {
		return arts;
	}

	public void setArts(ArrayList<Article> arts) {
		this.arts = arts;
	}
	
	public Combo(String name, String desc, double price, ArrayList<Article> arts) {
		super(name,desc,price,null,new Category("Combo"));
		this.setArts(arts);
		//Capaz Agregar Ingredientes si pinta
	} 

	public Combo(String name, String desc,int primaryKey, double price, ArrayList<Article> arts) {
		super(name,desc,primaryKey,price,null,new Category("Combo"));
		this.setArts(arts);
	}

	
	public Combo(ComboVO comb){
		super(comb);
		this.arts = new ArrayList<Article>();
		for(ArticleVO o : comb.getArts())
			arts.add(new Article(o));
	}
	
	public ComboVO toVO(){
		ArrayList<ArticleVO> temp = new ArrayList<ArticleVO>();
		for(Article o : this.arts)
			temp.add(o.toVO());
		return new ComboVO(super.name, super.desc, super.primaryKey, super.price, temp);
	}
	
}
